package com.huike.util;

public class UserContext {
    private static final ThreadLocal<Long> user=new ThreadLocal<>();
    //查询ThreadLocal的数据
    public static Long getUser() {
        return user.get();
    }
    //设置ThreadLocal的数据
    public static void setUser(Long id){
        user.set(id);
    }
    //删除ThreadLocal的数据
    public static void remove(){
        user.remove();
    }
}
